Before you can add atoms to an atom container, you must first create the container by calling QTNewAtomContainer . The code sample shown in Listing 6 calls QTNewAtomContainer to create an atom container and then calls SetSpriteData to add data for a background sprite to the container.
Listing 6 Creating a new atom container
QTAtomContainer spriteData;
OSErr err
// create an atom container to hold a sprite's data
err=QTNewAtomContainer (&spriteData);
When you have finished using an atom container, you should dispose of it by calling the QTDisposeAtomContainer function. The sample code shown in Listing 7 calls QTDisposeAtomContainer to dispose of two atom containers, sample and spriteData .
Listing 7 Disposing of atom containers
if (sample)
QTDisposeAtomContainer (sample);
if (spriteData)
QTDisposeAtomContainer (spriteData);